/**
 * 
 */
package dms.repository;

import java.util.Date;
import java.util.List;

import dms.model.Building;
import dms.model.Dormitory;
import dms.model.form.Mail;
import dms.model.util.PageIterator;

/**
 * @author 李健
 *
 */
public interface MailRepository {

	Mail findById(Long id);
	
	PageIterator<Mail> findByBuilding(int start, int count, Building building, Date fromDate, Date toDate);
	
	PageIterator<Mail> findByStudent(int start, int count, String student, Date fromDate, Date toDate);
	
	PageIterator<Mail> findByBuildingStudent(int start, int count, Building building, String student, Date fromDate, Date toDate);
	
	PageIterator<Mail> findByDormitory(int start, int count, Dormitory dormitory, Date fromDate, Date toDate);
	
	Mail createMail(Mail mail) throws Exception;
	
	Mail updateMail(Mail mailInfo) throws Exception;
	
	void deleteById(Long id) throws Exception;
	
	void deleteMails(List<Long> ids) throws Exception;
}
